<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>E停车电子收费系统</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    {% load staticfiles %}
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="{% static 'plugins/bootstrap/css/bootstrap.min.css' %}">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link href="https://cdn.bootcss.com/ionicons/2.0.1/css/ionicons.css" rel="stylesheet">
    <!-- Theme style -->
    <link rel="stylesheet" href="{% static 'css/AdminLTE.min.css' %}">
    <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
          page. However, you can choose any other skin. Make sure you
          apply the skin class to the body tag so the changes take effect.
    -->
    <link rel="stylesheet" href="{% static 'css/skins/skin-blue.min.css' %}">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
      <![endif]-->
    <link rel="stylesheet" href="{% static 'plugins/layer/skin/default/layer.css' %}">
    <link rel="stylesheet" href="{% static 'css/common.css' %}">
    {% block css %}{% endblock %}
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    {% include 'layout/header.html' %}
    {% include 'layout/sidebar.html' %}
    {% block content %}{% endblock %}
    <!-- /.content-wrapper -->
    {% include 'layout/footer.html' %}
</div>
<!-- ./wrapper -->
<!-- REQUIRED JS SCRIPTS -->
<!-- jQuery 2.1.4 -->
<script src="{% static 'plugins/jQuery/jQuery-2.1.4.min.js' %}"></script>
<!-- Bootstrap 3.3.5 -->
<script src="{% static 'plugins/bootstrap/js/bootstrap.min.js' %}"></script>
<!-- AdminLTE App -->
<script src="{% static 'js/app.min.js' %}"></script>
<!-- https://github.com/sentsin/layer/ -->
<script src="{% static 'plugins/layer/layer.js' %}"></script>
{% block js %}{% endblock %}
<script>
    $(function () {
        // CSRF code
        function getCookie(name) {
            var cookieValue = null;
            var i = 0;
            if (document.cookie && document.cookie !== '') {
                var cookies = document.cookie.split(';');
                for (i; i < cookies.length; i++) {
                    var cookie = jQuery.trim(cookies[i]);
                    // Does this cookie string begin with the name we want?
                    if (cookie.substring(0, name.length + 1) === (name + '=')) {
                        cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                        break;
                    }
                }
            }
            return cookieValue;
        }

        var csrftoken = getCookie('csrftoken');

        function csrfSafeMethod(method) {
            // these HTTP methods do not require CSRF protection
            return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
        }

        $.ajaxSetup({
            crossDomain: false, // obviates need for sameOrigin test
            beforeSend: function (xhr, settings) {
                if (!csrfSafeMethod(settings.type)) {
                    xhr.setRequestHeader("X-CSRFToken", csrftoken);
                }
            }
        });
        // csrf end
        // menus css set
        $('.sidebar-menu a').each(function () {
            if ($(this).attr('href') == location.pathname) {
                $(this).parent().attr('class', 'active');
                if ($(this).parent().parent().parent().attr('class') == 'treeview')
                    $(this).parent().parent().parent().attr('class', 'treeview active');
            }
        })
    });
</script>
</body>
</html>